<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">

<script type="text/javascript">
Ext.onReady(function(){
	Ext.QuickTips.init();	//初始化Ext.QuickTips，以使得tip提示可用
	Ext.form.Field.prototype.msgTarget='side';		//提示后面显示图片标记
	RoleFormPanel = Ext.extend(Ext.form.FormPanel,{
		constructor:function(){
			RoleFormPanel.superclass.constructor.call(this,{
				id:'roleFormid',
				labelWidth:80,
				defaults:{anchor:'90%'},		//自动拉伸
				baseCls:'x-plain',			//强制设置窗体颜色
				defaultType:'textfield',
				bodyStyle:'padding:8px',
				items:[{
					xtype:'hidden',
					name:'id'
				},{
					fieldLabel:'角色名称',
					allowBlank:false,
					name:'rolename',
					maxLength:50
				},{
					fieldLabel:'备注',
					xtype:'textarea',
					maxLength :500,
					name:'remark'
				}]
			})
		},
		getValues:function(){
			//alert(Ext.util.JSON.encode(this.form.getValues()));
			if(this.getForm().isValid()){
				this.fireEvent("submit",this,this.form.getValues());
			}else{
				throw Error("表单验证未通过！");		//抛出异常，在调用getValues函数的地方捕获并提示
			}
			//alert(this.getForm().getValues());
			return new Ext.data.Record(this.getForm().getValues());
		},
		setValues:function(re){
			this.getForm().loadRecord(re);
		},
		reset:function(){
			this.getForm().reset();
		}
	});
	
	SimpleTreePanel = Ext.extend(Ext.tree.TreePanel,{
		constructor:function(){
			SimpleTreePanel.superclass.constructor.call(this,{
				//baseCls:'x-plain',			//强制设置窗体颜色
				id:'treeLoad',
				title : "用户权限结构",
				bodyStyle:'padding:8px',
				width:480,
				height:400,
				
				autoScroll : true, // 自动滚动
				loader:new Ext.tree.TreeLoader({
					url:'roleauthtree.action' 
				}),
				root:new Ext.tree.AsyncTreeNode({
					expanded :true,	//自动展开树结构
					text:'权限结构',
					id:'0'					
				}),
				listeners:{
					'checkchange':{
						fn:this.onCheckChanage,
						scope:this
					}
				}
			});
		},
		onCheckChanage:function(node, checked) {
            node.expand();
            node.attributes.checked = checked;
            node.eachChild(function(child) {
                        child.ui.toggleCheck(checked);
                        child.attributes.checked = checked;
                       // child.fireEvent('checkchange', child,checked);
                    })
		}
		
	});
	
	/**
	 * 弹出编辑窗口类，提供创建和修改使用
	 */
	 RoleWindow = Ext.extend(Ext.Window,{
		//将FormPanel放到Window中
		form:null,
		tree:null,
		constructor:function(){
			this.form = new RoleFormPanel(),
			this.tree = new SimpleTreePanel(),
			RoleWindow.superclass.constructor.call(this,{
				plain:true,			//通过背景颜色来渲染窗口颜色
				width:500,
				modal:true,			//只能操作当前窗口
				closeAction:'hide',
				resizable:false,
				items:[this.form,this.tree],
				buttons:[{
						text:'确定',
						handler:this.onsubmit,
						scope:this
					},{
						text:'取消',
						handler:this.oncanel,
						scope:this
					}]
			});
			this.addEvents("submit");
		},	
		close:function(){
			this.form.reset();
			this.clearChildNodeChecked(this.tree);
			this.hide();
		},
		clearChildNodeChecked:function (tree){  
			var nodes = tree.getNodeById('0');	//获得根节点下所有的节点
			//去掉所有的节点中勾选的
			nodes.eachChild(function(child) {
                child.ui.toggleCheck(false);
                child.attributes.checked = false;
            })
		} ,
		resetChildNodeChecked:function (tree){  
			var nodes = tree.getNodeById('0');	//获得根节点下所有的节点
			//去掉所有的节点中勾选的
			nodes.eachChild(function(child) {
                child.ui.toggleCheck(true);
                child.attributes.checked = true;
            })
		} ,
		onsubmit:function(){
			var msg ="";
			try{
				this.fireEvent("submit",this,this.form.getValues());
				//获得Form提交后的ID,如果为空,表示添加,否则为修改
				var id = Ext.util.JSON.encode(this.form.getValues().data.id);
				var checkedArr = this.tree.getChecked();
				 var checkid = new Array;// 存放选中id的数组
                 for (var i = 0; i < checkedArr.length; i++) {
                     checkid.push(checkedArr[i].id);// 添加id到数组
                 }
				Ext.Ajax.request({
					url:'addrole.action',
					params:{
						content:"["+Ext.util.JSON.encode(this.form.getValues().data)+"]",
						dataStr:checkid
					},
					//提交成功后,处理一些事务
					 success : function(response){
						//alert(response.responseText);
						var value = Ext.util.JSON.decode(response.responseText);
						//获得后台返回的标记
						msg = value.msg;
						if(msg == '1'){
							Ext.Msg.alert('提示',"提交的角色名称已存在,请修改!");
							//return ;
						}else{
							var roleRecord =new Ext.data.Record.create(['id','rolename','remark']);
							var cdata = new roleRecord(value.role);
							//alert(Ext.util.JSON.encode(cdata.data));
							//将数据插入到第一行,并删除store最后一行
							var gridStore = Ext.getCmp('roleGrid').store;
							var c = id.replace('"','').replace('"','');		//去除不必要的符号
							if(""==c){
								if(gridStore.getCount() == 20){
									gridStore.insert(0,cdata);
									gridStore.remove(gridStore.getAt(gridStore.getCount()-1));
								}else{
									gridStore.insert(0,cdata);
								}
							}else{
								var selectRe = Ext.getCmp('roleGrid').getSelectionModel().getSelected();			//获得Grid选择的record
								var data = selectRe.data;
								//alert(Ext.util.JSON.encode(data));		//获得Record的数据，然后转换成JSON打印
								//遍历record.data,修改原record的值
								for(var i in data){
									selectRe.set(i,cdata.get(i));
								}
								selectRe.commit();
							}
							//alert(RoleWindow.width);
							//刷新角色权限关系表的数据
								Ext.getCmp('roleAuthorityGrid').store.load({
									//params:{start:0,limit:20}
								})
						}
					}  
				});
			}catch(err){
				Ext.Msg.alert('提示',err);
				return ;
			}
			this.close();
		},
		oncanel:function(){
			this.close();
		}
	}) ;
	
	/*********************************/
	//添加
	InsertRoleWindow = Ext.extend(RoleWindow,{
		title:'添加角色',
	//	tree:new SimpleTreePanel() 
	});
	//修改
	UpdateRoleWindow = Ext.extend(RoleWindow,{
		//id:Ext.getCmp('roleGrid'),
		title:'修改角色',
		load:function(re){
			this.form.setValues(re);
		}
	});
	/**
	 * Role数据显示Grid
	 */
	RoleGrid = Ext.extend(Ext.grid.GridPanel,{
		insertRoleWin:new InsertRoleWindow(),
		//updateRoleWin:new UpdateRoleWindow(),
		constructor:function(){
			this['store']= new Ext.data.JsonStore({
				root:'rolelist',
				totalProperty:'rolecnt',
				url:'rolelist.action',
				fields:[{
					name:'id', type: 'int'
				},'rolename','remark']
			}),
			//ToolBar
			this['toolBar'] = new Ext.Toolbar({
				
				items:[{
					text:'新增角色',
					icon:'imgs/database_key.png',
					cls: "x-btn-text-icon" ,		//自定义图片
					handler:function(){
						this.insertRoleWin.show();
					},
					scope:this
				},{
					text:'修改角色和权限',
					icon:'imgs/database_edit.png',
					cls: "x-btn-text-icon" ,		//自定义图片
					handler:function(){
						this.onRoleModify(false)
					},
					scope:this
				},{
					text:'删除角色和权限',
					icon:'imgs/database_delete.png',
					cls: "x-btn-text-icon" ,		//自定义图片
					handler:function(){
						this.onRoleRemove()	
					},
					scope:this
				},{
					text:'查看角色权限',
					icon:'imgs/database_go.png',
					cls: "x-btn-text-icon" ,		//自定义图片
					handler:function(){
						this.onRoleModify(true)
					},
					scope:this
				}]
			})
			
			RoleGrid.superclass.constructor.call(this,{
				id:'roleGrid',
				title:'角色列表',
				//renderTo:'roleGrid',
 				width:Ext.getBody().getWidth()/2-206,
 				height:Ext.getBody().getHeight()/2-80,
				autoExpandColumn:1,
				//height : Ext.get('dataDictGrid').getHeight(), 
				sm:new Ext.grid.RowSelectionModel({
						singleSelect:true
				}),
				tbar:this.toolBar,
				bbar:new Ext.PagingToolbar({
					pageSize:20,
					store:this.store,
					displayInfo:true,
					displayMsg:'第{0}条到{1}条，共{2}条',
					emptyMsg:'没有记录'
				}),
				columns:[
				         	{
								header:'角色名称',
								width:200,
								dataIndex:'rolename',
								
								sortable:true
							},{
								header:'备注',
								dataIndex:'remark',
								sortable:true
							}]
			});
			this.getStore().load({
				url:'rolelist.action',
				params:{start:0,limit:20}
			});
		Ext.Ajax.on('requestcomplete',this.requestFunction,this);
	},
	//获得用户的权限和角色信息
	onRoleModify:function(isQuery){
		var sm = this.getSelectionModel();
		if(sm.getCount() == 0){
			Ext.Msg.alert('提示','需要选择一条数据');
		}else{
			var w = new UpdateRoleWindow();
			w.show();
			w.load(sm.getSelected());
			if(isQuery){
				var buttons = w.buttons[0];
				buttons.setVisible(false);
			}
			Ext.Ajax.request({
				url:'findroleauhoritystr.action',
				params:{
					'role.id':sm.getSelected().get('id')
				},
				success : function(response){
					var str =Ext.util.JSON.decode(response.responseText).dataStr;
					var strArr = str.split(',');
					w.tree.expandAll();
					
					var nodes = w.tree.getNodeById('0');  //获得根节点下所有的节点
			        nodes.eachChild(function(child) {
			          	if(child.hasChildNodes()){
			            	child.eachChild(function(child1){
			            		for(var i = 0; i< strArr.length;i++){
			                  		if(strArr[i] == child1.attributes.id){
										child1.ui.toggleCheck(true);
										child1.attributes.checked = true;
			                  		}
			                	}
			              	});
			            }else{
			              	for(var i = 0; i< strArr.legnth;i++){
			                	if(strArr[i] == child.attributes.id){
			                  		child.ui.toggleCheck(true);
			                    	child.attributes.checked = true;
			                	}
			              	}
			            }
			    	});
				}  
			});	//修改时，form联动
			
		}
	},
	//判断用户是否选择了数据
	getSelected:function(){
		var sm = this.getSelectionModel();
		if(sm.getCount() == 0){
			throw Error('需要选择一条数据');
		}
		return sm.getSelected();	
		
	},
	//删除数据
	onRoleRemove:function(){
		var sm = this.getSelectionModel();
		if(sm.getCount() == 0){
			Ext.Msg.alert('提示','需要选择一条数据');
		}else{
			Ext.Msg.confirm('提示','是否删除？',function(btn, text){
				if(btn == 'yes'){
					try{
						var store = this.store;
						var selectRe = this.getSelected();			//获得Grid选择的record
						store.remove(selectRe);
						Ext.Ajax.request({
							url:'delrole.action',
							params:{
								'role.id':selectRe.get('id')
							},
							success : function(response){
								//alert(response.responseText);
								store.load({
										params:{start:0,limit:20}
									});
								//刷新角色权限关系表的数据
								Ext.getCmp('roleAuthorityGrid').store.load({
									//params:{start:0,limit:20}
								})
							}  
							
						});	//修改时，form联动
					}catch(err){
						Ext.Msg.alert('提示','需要选择一条数据');
					}
					//删除后,直接刷新
					
				}
			},this);
		}
	},
	//在插入数据的时候,返回的ID需要重新加载到insertdata对象中,这样就同数据库一样了,根据ID可以修改和删除数据
	requestFunction:function(conn,response,options){
// 			var c = Ext.util.JSON.decode(response.responseText);
// 			alert(c.list)
		}
	});
	
	
	AuthorityFormPanel = Ext.extend(Ext.form.FormPanel,{
		constructor:function(){
			AuthorityFormPanel.superclass.constructor.call(this,{
				labelWidth:80,
				defaults:{anchor:'90%'},		//自动拉伸
				baseCls:'x-plain',			//强制设置窗体颜色
				defaultType:'textfield',
				bodyStyle:'padding:8px',
				items:[{
					xtype:'hidden',
					name:'id'
				},{
					fieldLabel:'权限名称',
					allowBlank:false,
					name:'authorityname',
					maxLength:50
				},{
					fieldLabel:'权限代码',
					allowBlank:false,
					name:'authoritycode',
					maxLength:50
// 				},{
// //						store:new Ext.data.SimpleStore({
// //						fields:['fontValue','fontName'],
// //						data:[['1','宋体'],['2','楷体'],['3','魏碑'],['4','黑体']]
// //					}),
// 				fieldLabel:'父节点',
// 				xtype:'combo',
// 				triggerAction:'all',
// 				displayField:'value',
// 				editable:false,
// 				//远程调用,查询到数据库中的数据,然后显示
// 				store:rankData = new Ext.data.JsonStore({  
// 					root:'comboList',
// 		            proxy : new Ext.data.HttpProxy({  
//                         url : 'findparauth.action'  
//                     }),  
//                     fields:['key','value']
//         		})
			},{
					fieldLabel:'备注',
					xtype:'textarea',
					maxLength :500,
					name:'remark'
				}]
			})
		},
		getValues:function(){
			//alert(Ext.util.JSON.encode(this.form.getValues()));
			if(this.getForm().isValid()){
				this.fireEvent("submit",this,this.form.getValues());
			}else{
				throw Error("表单验证未通过！");		//抛出异常，在调用getValues函数的地方捕获并提示
			}
			//alert(this.getForm().getValues());
			return new Ext.data.Record(this.getForm().getValues());
		},
		setValues:function(re){
			this.getForm().loadRecord(re);
		},
		reset:function(){
			this.getForm().reset();
		}
	});
	
	
	
	/**
	 * 弹出编辑窗口类，提供创建和修改使用
	 */
	 AuthorityWindow = Ext.extend(Ext.Window,{
		//将FormPanel放到Window中
		form:null,
		constructor:function(){
			this.form = new AuthorityFormPanel(),
			AuthorityWindow.superclass.constructor.call(this,{
				plain:true,			//通过背景颜色来渲染窗口颜色
				width:500,
				modal:true,			//只能操作当前窗口
				closeAction:'hide',
				items:this.form,
				buttons:[{
						text:'确定',
						handler:this.onsubmit,
						scope:this
					},{
						text:'取消',
						handler:this.oncanel,
						scope:this
					}]
			});
			this.addEvents("submit");
		},	
		close:function(){
			this.form.reset();
			this.hide();
		},
		onsubmit:function(){
			try{
				this.fireEvent("submit",this,this.form.getValues());
				//获得Form提交后的ID,如果为空,表示添加,否则为修改
				var id = Ext.util.JSON.encode(this.form.getValues().data.id);
				Ext.Ajax.request({
					url:'addauthority.action',
					params:{
						content:"["+Ext.util.JSON.encode(this.form.getValues().data)+"]"
					},
					//提交成功后,处理一些事务
					 success : function(response){
						//alert(response.responseText);
						var value = Ext.util.JSON.decode(response.responseText);
						var authorityRecord =new Ext.data.Record.create(['id','authorityname','authoritycode','remark']);
						var cdata = new authorityRecord(value.authority);
						//alert(Ext.util.JSON.encode(cdata.data));
						//将数据插入到第一行,并删除store最后一行
						var gridStore = Ext.getCmp('authorityGrid').store;
						var c = id.replace('"','').replace('"','');		//去除不必要的符号
						if(""==c){
							if(gridStore.getCount() == 20){
								gridStore.insert(0,cdata);
								gridStore.remove(gridStore.getAt(gridStore.getCount()-1));
							}else{
								gridStore.insert(0,cdata);
							}
						}else{
							var selectRe = Ext.getCmp('authorityGrid').getSelectionModel().getSelected();			//获得Grid选择的record
							var data = selectRe.data;
							//alert(Ext.util.JSON.encode(data));		//获得Record的数据，然后转换成JSON打印
							//遍历record.data,修改原record的值
							for(var i in data){
								selectRe.set(i,cdata.get(i));
							}
							selectRe.commit();
						}
					}  
				});
			}catch(err){
				Ext.Msg.alert('提示',err);
				return ;
			}
			this.close();
		},
		oncanel:function(){
			this.close();
		}
	}) ;

	/*********************************/
	//添加
	InsertAuthorityWindow = Ext.extend(AuthorityWindow,{
		title:'添加权限'
	});
	//修改
	UpdateAuthorityWindow = Ext.extend(AuthorityWindow,{
		title:'修改权限',
		load:function(re){
			this.form.setValues(re);
		}
	});
	
	/**
	 * Authority数据显示Grid
	 */
	 AuthorityGrid = Ext.extend(Ext.grid.GridPanel,{
		insertAuthorityWin:new InsertAuthorityWindow(),
		updateAuthorityWin:new UpdateAuthorityWindow(),
		constructor:function(){
			this['store']= new Ext.data.JsonStore({
				root:'authoritylist',
				totalProperty:'authoritycnt',
				url:'authoritylist.action',
				fields:[{
					name:'id', type: 'int'
				},'authorityname','authoritycode','remark']
			}),
			//ToolBar
			this['toolBar'] = new Ext.Toolbar({
				
				items:[{
					text:'新增',
					icon:'imgs/server_add.png',
					cls: "x-btn-text-icon" ,		//自定义图片
					handler:function(){
						this.insertAuthorityWin.show();
					},
					scope:this
				},{
					text:'修改',
					icon:'imgs/server_edit.png',
					cls: "x-btn-text-icon" ,		//自定义图片
					handler:function(){
						this.updateAuthorityWin.show();						//首先,修改窗体显示
						try{											//然后将用户选择的数据回写到窗体上	
							this.updateAuthorityWin.load(this.getSelected());
						}catch(err){
							Ext.Msg.alert('提示',err.description);
							this.updateAuthorityWin.close();
						}
					},
					scope:this
				},{
					text:'删除',
					icon:'imgs/server_delete.png',
					cls: "x-btn-text-icon" ,		//自定义图片
					handler:function(){
						this.onAuthorityRemove()	
					},
					scope:this
				}]
			})
			
			AuthorityGrid.superclass.constructor.call(this,{
				id:'authorityGrid',
				title:'权限列表',
				//renderTo:'roleGrid',
				width:Ext.getBody().getWidth()/2,
				height:Ext.getBody().getHeight()/2-80,
				autoExpandColumn:2,
				//height : Ext.get('dataDictGrid').getHeight(), 
				sm:new Ext.grid.RowSelectionModel({
						singleSelect:true
				}),
				tbar:this.toolBar,
				bbar:new Ext.PagingToolbar({
					pageSize:20,
					store:this.store,
					displayInfo:true,
					displayMsg:'第{0}条到{1}条，共{2}条',
					emptyMsg:'没有记录'
				}),
				columns:[
				         	{
								header:'权限名称',
								width:200,
								dataIndex:'authorityname',
								sortable:true
							},{
								header:'权限代码',
								width:200,
								dataIndex:'authoritycode',
								sortable:true
							},{
								header:'备注',
								dataIndex:'remark',
								sortable:true
							}]
			});
			this.getStore().load({
				url:'authoritylist.action',
				params:{start:0,limit:20}
			});
		Ext.Ajax.on('requestcomplete',this.requestFunction,this);
	},
	//判断用户是否选择了数据
	getSelected:function(){
		var sm = this.getSelectionModel();
		if(sm.getCount() == 0){
			throw Error('需要选择一条数据');
		}
		return sm.getSelected();	
		
	},
	//删除数据
	onAuthorityRemove:function(){
		var sm = this.getSelectionModel();
		if(sm.getCount() == 0){
			Ext.Msg.alert('提示','需要选择一条数据');
		}else{
			Ext.Msg.confirm('提示','是否删除？',function(btn, text){
				if(btn == 'yes'){
					try{
						var store = this.store;
						var selectRe = this.getSelected();			//获得Grid选择的record
						store.remove(selectRe);
						Ext.Ajax.request({
							url:'delauthority.action',
							params:{
								'authority.id':selectRe.get('id')
							},
							success : function(response){
								//alert(response.responseText);
								store.load({
										params:{start:0,limit:20}
									});
							}  
							
						});	//修改时，form联动
					}catch(err){
						Ext.Msg.alert('提示','需要选择一条数据');
					}
					//删除后,直接刷新
					
				}
			},this);
		}
	},
	//在插入数据的时候,返回的ID需要重新加载到insertdata对象中,这样就同数据库一样了,根据ID可以修改和删除数据
	requestFunction:function(conn,response,options){
// 			var c = Ext.util.JSON.decode(response.responseText);
// 			alert(c.list)
		}
	});
	/**
	 * 数据显示Grid
	 */
	 RoleAuthorityGrid = Ext.extend(Ext.grid.GridPanel,{
		constructor:function(){
			this['store']= new Ext.data.GroupingStore({
				proxy : new Ext.data.HttpProxy({  
				    url : 'findallroleauth.action'  
				}),  
				groupField:'rolename',
				sortInfo:{field: 'rolename', direction: "ASC"},
				reader:new Ext.data.JsonReader({
					root:'list',
					totalProperty:'cnt'
					
				},
				Ext.data.Record.create([{
						name:'id', type: 'int'
						},{
							name:'roleid', type: 'int'
						},{
							name:'authorityid', type: 'int'
						},'rolename','authorityname','authoritycode','remark'])
			)
		}),
			//ToolBar
			this['toolBar'] = new Ext.Toolbar({
				
				items:[{
					text:'新增',
					icon:'imgs/add.gif',
					cls: "x-btn-text-icon" ,		//自定义图片
					handler:function(){
						this.insertDataDict.show();
					},
					scope:this
				}]
			})
			
			RoleAuthorityGrid.superclass.constructor.call(this,{
				id:'roleAuthorityGrid',
				title:'角色权限关系对照表',
				//width:400,
				//renderTo:'roleGrid',
				height:Ext.getBody().getHeight()/2-60,
				autoExpandColumn:4,
				//height : Ext.get('dataDictGrid').getHeight(), 
				sm:new Ext.grid.CheckboxSelectionModel({
					singleSelect:true
				}),
				//tbar:this.toolBar,
// 				bbar:new Ext.PagingToolbar({
// 					pageSize:20,
// 					store:this.store,
// 					displayInfo:true,
// 					displayMsg:'第{0}条到{1}条，共{2}条',
// 					emptyMsg:'没有记录'
// 				}),
				view: new Ext.grid.GroupingView({
		            forceFit:true,
		            groupTextTpl: '{text} ({[values.rs.length]} {[values.rs.length > 1 ? "Items" : "Item"]})'
		        }),
				columns:[
				         	new Ext.grid.CheckboxSelectionModel({
				         		singleSelect : true
				         	}),{
								header:'角色名称',
								dataIndex:'rolename',
								sortable:true
							},{
								header:'权限名称',
								dataIndex:'authorityname',
								sortable:true
							},{
								header:'权限代码',
								dataIndex:'authoritycode',
								sortable:true
							},{
								header:'备注',
								dataIndex:'remark',
								sortable:true
							}]
			});
			this.getStore().load({
				url:'findallroleauth.action'
				//params:{start:0,limit:20}
			});
			//this.insertDataDict.on('submit',this.onsubmit,this);		//为可视化窗口:insertWin添加事件(事件名称，调用的函数，scope)
		Ext.Ajax.on('requestcomplete',this.requestFunction,this);
	},
	
	//在插入数据的时候,返回的ID需要重新加载到insertdata对象中,这样就同数据库一样了,根据ID可以修改和删除数据
	requestFunction:function(conn,response,options){
// 			var c = Ext.util.JSON.decode(response.responseText);
// 			alert(c.list)
//			var res = c.list;
//			for(var i = 0;i<res.length;i++){
//				var rc = res[i];
//			}
	}
	});
	
	var g1 = new RoleGrid();
	g1.render('roleGrid1');
	var g2 = new AuthorityGrid();
	g2.render('roleGrid2');
	var g3 = new RoleAuthorityGrid();
	g3.render('roleGrid3');
});
</script>
<title>权限列表</title>
</head>
<body>
<table>
	<tr>
		<td><div id="roleGrid1" style="width:30%; height:50%"></td>
		<td><div id="roleGrid2" style="width:70%; height:50%"></td>
	</tr>
	<tr>
		<td colspan="2"><div id="roleGrid3" style="width:100%; height:50%"></td>
	</tr>
</table>
<div id="roleGrid"></div>
</body>
</html>